package tr.edu.yildiz.samplegui;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;

import tr.edu.yildiz.crystalapp.view.ViewFactory;
import tr.edu.yildiz.samplegui.view.SampleGuiViewFactory;

public class Activator implements BundleActivator{

	ServiceReference reference = null;
	
	public void start(BundleContext context) throws Exception {
		System.out.println("Activator............................................................" +
				"................................................................................" +
				"................................................................................" +
				"................................................................................" +
				"................................................................................" +
				"................................................................................" +
				"................................................................................" +
				"................................................................................" +
				"................................................................................" +
				"................................................................................" +
				"................................................................................" +
				"................................................................................" +
				"................................................................................" );
		ServiceRegistration reg = context.registerService(ViewFactory.class.getName(), new SampleGuiViewFactory(), null);
		reference = reg.getReference();
	}

	public void stop(BundleContext context) throws Exception {
		context.ungetService(reference);
	}

}
